using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Syncfusion.Windows.Forms;
using Syncfusion.Windows.Forms.Tools;




namespace Omega.Editor.Forms
{
    public partial class FrmEditor : Office2007Form
    {

        
        public FrmEditor()
        {
            InitializeComponent();
            Classes.Editor.Init(this);
            this.Cursor = new Cursor("cur1054.cur");
        }

        #region Eventos Menu Ribbon

        #region TabArquivo

        //evento "click" criar novo projeto 
        private void projetoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Forms.FrmNewProject f = new FrmNewProject();
            f.OpenDialog();

        }
        #endregion

        #region TabVer
        private void BtnScene_Click(object sender, EventArgs e)
        {
            Classes.AreaDeTrabalho.DockControl(Classes.AreaDeTrabalho.UniqueName.OpenGlWindow);
        }

        private void BtnOutput_Click(object sender, EventArgs e)
        {
            Classes.AreaDeTrabalho.DockControl(Classes.AreaDeTrabalho.UniqueName.CntrlOutPut);
        }
        #endregion



        private void toolStripButton1_Click(object sender, EventArgs e)
        {
        }


        #endregion
        #region Eventos Gerais

        private void FrmEditor_FormClosing(object sender, FormClosingEventArgs e)
        {
            switch (this.WindowState)
            {
                case FormWindowState.Maximized:
                    Classes.Registro.Gravar("Omega\\Config\\", "WindowState", 0);
                    break;

                case FormWindowState.Normal:
                    Classes.Registro.Gravar("Omega\\Config\\", "WindowState", 1);
                    Classes.Registro.Gravar("Omega\\Config\\", "WindowWidth", this.Width);
                    Classes.Registro.Gravar("Omega\\Config\\", "WindowHeight", this.Height);
                    Classes.Registro.Gravar("Omega\\Config\\", "WindowPosX", this.Location.X);
                    Classes.Registro.Gravar("Omega\\Config\\", "WindowPosY", this.Location.Y);
                    break;

                default:
                    break;

            }
        }

        private void FrmEditor_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.ExitThread();
        }

        private void FrmEditor_Load(object sender, EventArgs e)
        {
            int WindowState = Classes.Registro.Ler("Omega\\Config\\", "WindowState", 0);

            if (WindowState == 0)
                this.WindowState = FormWindowState.Maximized;
            else
            {
                this.WindowState = FormWindowState.Normal;
                this.Width = Classes.Registro.Ler("Omega\\Config\\", "WindowWidth", this.Width);
                this.Height = Classes.Registro.Ler("Omega\\Config\\", "WindowHeight", this.Height);
                this.Location = new Point(Classes.Registro.Ler("Omega\\Config\\", "WindowPosX", this.Location.X),
                Classes.Registro.Ler("Omega\\Config\\", "WindowPosY", this.Location.Y));
            }
        }
        #endregion

        






    }
}